import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

import { IndexedDBService } from '../../services/indexeddb.service'

/**
 * Generated class for the SettingsPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */

@IonicPage()
@Component({
    selector: 'page-settings',
    templateUrl: 'settings.html',
})
export class SettingsPage {

    info: any;

    constructor(
        public navCtrl: NavController, 
        public navParams: NavParams,
        private indexedDb: IndexedDBService
    ) {
        let myId = indexedDb.myId;
        this.info = indexedDb.userInfors[myId];
    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad SettingsPage');
    }

    personalInfo() {
        this.navCtrl.push("PersonalInfoPage", {
            info: this.info
        });
    }

}
